#include <bits/stdc++.h>

using namespace std;

using ll = long long;

const int N = 1e5+5;

int n,a[N];

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);

    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    for (int i=1; i<=n; i++){
        cin>>a[i];
    }
    sort(a+1,a+1+n);
    multiset<int> st;
    for (int i=1; i<=n; i++){
        if (st.empty()){
            st.insert(a[i]);
        }
        else{
            auto it=st.lower_bound(a[i]);
            if (it!=st.begin()){
                it--;
                if ((*it)<a[i]) st.erase(st.find(*it));
            }
            st.insert(a[i]);
        }
    }
    cout<<st.size()<<"\n";
    return 0;
}

/*
Things to check:
    - int/long long overflow?
    - mod, +mod, %mod?
    - array bounds?
    - Places where you think can't be wrong.
    - Functions should return if not "void".
    - what is the memory limit? the mod? the name etc.
Things to think of:
    - Be brave to guess and be optimistic.
    - Start from a trivial case.
    - What is the expected time to finish this problem?
Do not be afraid of a problem, try.
Do not devote all your time into a problem, look at other problems.
*/